﻿<?xml version="1.0" encoding="utf-8" ?>
<!--
***********************************************************************
 
  Copyright (C) Microsoft Corporation.  All rights reserved.
 
 THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 PARTICULAR PURPOSE.
***********************************************************************
-->

<Product 
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Office.PIA.2003Or2007_WordOnly" 
>

  <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Net.Framework.2.0" />
  </RelatedProducts>

  <!-- Defines the list of files to be copied on build. -->
  <PackageFiles>
    <PackageFile Name="O2003PIA.msi"/>
    <PackageFile Name="o2007pia.msi"/>
    <PackageFile Name="ComponentChk.exe"/>
  </PackageFiles>

  <InstallChecks>
  
    <!--
	This product.xml sample checks for the Microsoft Office Word application.
	-->

<!--
	External check for Microsoft Office Word 2007. 
    <ExternalCheck 
      Property="SupportedWordVersionInstalled" 
      PackageFile="ComponentChk.exe" 
      Arguments="/delete /save /word {0638C49D-BB8B-4CD1-B191-050E8F325736}"
	/>
-->
	
	<!-- External check for Microsoft Office Word 2003. -->
    <ExternalCheck 
      Property="SupportedWordVersionInstalled" 
      PackageFile="ComponentChk.exe" 
      Arguments="/delete /save /word {1EBDE4BC-9A51-4630-B541-2561FA45CCC5}"
	/>
	  
	<!-- External check for primary interop assemblies (PIAs). -->
	<!--
	  Product Codes:
	  {91490409-6000-11D3-8CFE-0150048383C9} Office 2003 PIA
	  {50120000-1105-0000-0000-0000000FF1CE} Office 2007 PIA
	-->
	
	<ExternalCheck
      Property="PIAsRegistered"
      PackageFile="ComponentChk.exe"
      Arguments="/save {91490409-6000-11D3-8CFE-0150048383C9} {50120000-1105-0000-0000-0000000FF1CE}"
	/>

  </InstallChecks>
    
	<!-- Defines how to run the Setup package. -->
  <Commands Reboot="Defer">
	
	<!--
	Office Product download codes (from http://technet.microsoft.com/en-us/library/cc179070.aspx):
	{90120000-001B-0000-0000-0000000FF1CE} Word 2007
	-->
	<Command 
	  PackageFile="ComponentChk.exe"
	  Arguments="/install /word O2003PIA.msi {90120000-001B-????-0000-0000000FF1CE} o2007pia.msi"
	  EstimatedInstalledBytes="30000000"
	  EstimatedInstallSeconds="60"
	>
      
	  <InstallConditions>
	  
	  <!--
	      This sample product.xml file checks for the Microsoft Office Word application.
	     -->
	 
		<FailIf 
		  Property="SupportedWordVersionInstalled"
		  Compare="ValueGreaterThan"
		  Value="1"
		  String="WordRequired"
		/>
	
		<BypassIf
		  Property="PIAsRegistered" 
		  Compare="ValueEqualTo" 
		  Value="1" 
		/>
		
		<FailIf 
		  Property="AdminUser" 
		  Compare="ValueEqualTo" 
		  Value="false" 
		  String="AdminRequired"
		/>
		
	  </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>
